<%@page import="com.kaishengit.entity.User"%>
<%@page import="com.kaishengit.entity.Product"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="checkuser.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
  <head>
    <title>My JSP 'main.jsp' starting page</title>
    <link href="style/bootstrap.min.css" rel="stylesheet">
    <style type="text/css">
    	body{
    		padding-top:70px;
    	}
    </style>
  </head>
  
  <body>
    <%@ include file="top.jsp" %>
	
	<div class="container">
		<a class="btn primary" href="product.jspx?task=save">添加新商品</a>
		<table class="zebra-striped">
			<thead>
				<tr>
					<th>商品名称</th>
					<th width="30%">商品价格</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody>
				<c:if test="${empty page.result}">
					<tr>
						<td colspan="3">暂时没有数据:)</td>
				</tr>
				</c:if>
				 <c:forEach items="${page.result }" var="pro">
				<tr>
					<td>${pro.prodName }</td>
					<td>￥${pro.price }</td>
					<td>
						<a href="product.jspx?task=edit&id=${pro.id }">修改商品</a>
						<a href="product.jspx?task=del&id=${pro.id }">删除</a>
					</td>
				</tr>
				</c:forEach>
			</tbody>
    	</table>
 
	</div>
	
  </body>
</html>
